package com.example.config;

import org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * @Project: SSM-JavaConfig
 * @Title: RootConfig
 * @Description: <p>管理ContextLoadListener创建的上下文的bean </p>
 * @Author: zhuzhaofeng
 * @Email: zhuzhaofeng@aliyun.com
 * @dateTime: 2018-12-23 16:43
 * @Version: 1.0.0
 */
@Configuration
@ComponentScan(basePackages={ "com.example.config", "com.example.dao", "com.example.service" })
@Import(value = DruidDataSourceConfig.class)
public class RootConfig {
    @Bean
    public BeanNameAutoProxyCreator proxycreate(){
        BeanNameAutoProxyCreator proxycreate = new BeanNameAutoProxyCreator();
        proxycreate.setProxyTargetClass(true);
        proxycreate.setBeanNames("*ServiceImpl");
        proxycreate.setInterceptorNames("transactionInterceptor");
        return proxycreate;
    }
}
